<style>
    *{
            margin:0;
            padding: 0;
        }
      h6{
           font-size:20px;
           color:white;
           text-align:center;
           padding-top:600px;
       }
     
        .main{
          top:0;
          z-index:-2;
            width:100%;
            height:100%;
            background-color:#2e2e2e;
            position: fixed;
            display: flex;
            justify-content: center;
           align-items: center;
        }
        .main-content{
            
            width:80px;

            display: flex;
            flex-wrap: wrap;
        animation: xz 1s linear infinite;
        }
        @keyframes xz{
          to{
              transform: rotate(360deg);
          }
        }
      .main-content span{
          width:32px;
          height:32px;
          background-color: coral;
         margin: 4px;
      animation: scale 1.5s linear infinite;
      }

@keyframes scale{
50%{
    transform: scale(1.2);
}
}
      .main-content span:nth-child(1){
          border-radius: 50% 50% 0 50%;
          transform-origin: bottom right;
          background-color: #ff4757;
      }
      .main-content span:nth-child(2){
          border-radius: 50% 50% 50% 0;
          transform-origin: bottom left;
          background-color: #2ed573;
      
      }
      .main-content span:nth-child(3){
          border-radius: 50% 0% 50% 50%;
          transform-origin: top right; /*变形原点*/
          background-color: #1e90ff;
         
      }
      .main-content span:nth-child(4){
          border-radius: 0 50% 50% 50%;
          transform-origin: top left;
      }
    </style>
<script>
 window.addEventListener('load',function(){
     var h6=document.getElementById('text');
     var h7=document.getElementById('text1');


     setInterval(function(){
      var span= document.createElement('span');//添加标签
       var spantext=document.createTextNode('.');//添加标签内容
  span.appendChild(spantext);
  h7.appendChild(span);
     }, 300);

//每秒时间减1
     var time=2;
     setInterval(function(){
         h6.innerHTML='管理员用户名或密码错误'+'&nbsp;'+time+'秒钟后返回登录页面..';
         time--;
     },1000);
 });
</script>


<div class=main>
    <div class=main-content>
        <span></span>
        <span></span>
        <span></span>
        <span></span>
    </div>
    </div>

<?php
header("content-type:text/html; charset=utf-8");
session_start();
$name=$_POST['username'];
$pass=$_POST['password'];

//判断用户是否非法进入
if($name=="" || $pass==""){
    echo "请输入用户名或者密码！";
    echo "<p id=text>3秒钟后返回登录页面.</p>";//三秒钟后返回登录页面
    header("refresh:3;url=login.html");
}else{
    $serverLink=@mysql_connect("localhost","root","root") or die("连接服务器失败！程序中断");
    mysql_query("'set names 'utf-8'");
    $dbLink=@mysql_select_db("supermarket") or die("打开supermarket数据库失败！程序中断");
    $selectadm="select * from admsign  where admname='$name' and password='$pass'";
    $sqladm=mysql_query($selectadm);
    $outadm=mysql_fetch_assoc($sqladm);
    $outadm1=mysql_affected_rows();
    //判断数据库中是否有该用户信息，如果有则提示用户登录成功
       if($outadm1>0){
       echo "<h6><p id=text1>登录成功";
       echo "正在进入管理员系统.</p></h6>";
       $_SESSION['user-name']=$name;
       mysql_free_result($sqladm);
      header("refresh:1.5;url=subper.php");

       }else{
      echo "<h6>";
       echo "<p id='text'>管理员用户名或密码错误&nbsp;3秒钟后返回登录页面.</p></h6>";
      header("refresh:3;url=login.html");
  
    }
         
          mysql_close($serverLink);
}
?>
